package com.bawan.web.happy.util;

import java.security.MessageDigest;

import sun.misc.BASE64Encoder;

/**
 * <p> Description	: Encrypter.java </p>
 * <p> Copyright	: Copyright (c) 2015 by PCI-SUNTEK</p>
 * <p> Author 		: ZCCHUN </p>
 * <p> Create		: 2015年10月22日 下午4:49:56 </p> 
 * <p> version 		: 1.0 </p>
 */
public class Encrypter {
	public static String md5(String text) {
		try {
			MessageDigest messageDigest = MessageDigest.getInstance("MD5");
			sun.misc.BASE64Encoder base64Encoder = new BASE64Encoder();
			return base64Encoder.encode(messageDigest.digest(text.getBytes("utf8")));
		} catch (Exception e) {
			return text;
		}
	}
}
